﻿namespace GoodAdmin.CodeGenerator;

/// <summary>
/// 代码生成表单配置信息
/// </summary>
public class CodeGenFormConfig:BaseEntity
{
    /// <summary>
    /// 基础信息Id
    /// </summary>
    [SugarColumn(ColumnDescription = "基础信息Id")]
    public long CodeGenBaseId { get; set; }  
    /// <summary>
    /// 数据表信息
    /// </summary>
    [SugarColumn(ColumnDescription = "数据表信息", IsJson = true, ColumnDataType = StaticConfig.CodeFirst_BigString)]
    public List<TableInfo> TableInfoList { get; set; }

    /// <summary>
    /// 表单信息
    /// </summary>
    [SugarColumn(ColumnDescription = "表单信息", IsJson = true, ColumnDataType = StaticConfig.CodeFirst_BigString)]
    public string FormData { get; set; }
    /// <summary>
    /// 列表展示信息
    /// </summary>
    [SugarColumn(ColumnDescription = "列表展示信息", IsJson = true, ColumnDataType = StaticConfig.CodeFirst_BigString)]
    public string ListData { get; set; }
}

public class TableInfo
{
    /// <summary>
    /// 表名
    /// </summary>
    [SugarColumn(ColumnDescription = "表名", Length = 100)]
    public string Name { get; set; }
    /// <summary>
    /// 表描述
    /// </summary>
    [SugarColumn(ColumnDescription = "表描述", Length = 100)]
    public string Description { get; set; }
    /// <summary>
    /// 类型
    /// 主表，子表
    /// </summary>
    [SugarColumn(ColumnDescription = "类型", Length = 20)]
    public string TableType { get; set; }

}
